package Acm;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StreamTokenizer;
import java.util.Arrays;
import java.util.Comparator;

public class ASummationGame {
    public static void main(String[] args) throws IOException {
        StreamTokenizer st=new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
        st.nextToken();
        int n= (int) st.nval;
        for (int m = 0; m < n; m++) {
             st.nextToken();
             int len=(int) st.nval;
             st.nextToken();
             int A = (int) st.nval;
             st.nextToken();
             int B = (int) st.nval;
             Integer[] arr = new Integer[len];
             int sum = 0;
             int max = Integer.MIN_VALUE;
            for (int i = 0; i < len; i++) {
                st.nextToken();
                arr[i] = (int) st.nval;
                sum += arr[i];
            }
            Arrays.sort(arr, new Comparator<Integer>() {
                @Override
                public int compare(Integer o1, Integer o2) {
                    return o1 - o2;
                }
            });
            for (int i = 1; i < len; i++) {
                arr[i] = arr[i] + arr[i-1];
            }
            int index = len - 1;
            for (int i = 0; i <= A; i++) {
                int tmpIndex = ((index-i-B)>=0) ? (index-i-B) : -1;
                int tmp = 0;
                if(!(index - i < 0)){
                    if(tmpIndex < 0){
                        tmp = -arr[index-i];
                    }else{
                        tmp = arr[index-i] - 2*(arr[index - i] - arr[tmpIndex]);
                    }
                }
                max = Math.max(max,tmp);
            }
            System.out.println(max);
        }

    }
}
